/*     */ package com.umeng.update;
/*     */ 
/*     */ import android.content.Context;
/*     */ import com.umeng.common.c;
/*     */ import com.umeng.common.net.u;
/*     */ import com.umeng.common.util.h;
/*     */ import java.io.Serializable;
/*     */ import org.json.JSONObject;
/*     */ 
/*     */ public class UpdateResponse extends u
/*     */   implements Serializable
/*     */ {
/*     */   private static final long a = 20130701L;
/*  22 */   public boolean hasUpdate = false;
/*     */ 
/*  26 */   public String updateLog = null;
/*     */ 
/*  30 */   public String version = null;
/*     */   public String path;
/*     */   public String origin;
/*     */   public String proto_ver;
/*     */   public String new_md5;
/*     */   public String size;
/*     */   public String target_size;
/*  58 */   public boolean delta = false;
/*     */   public String patch_md5;
/*     */ 
/*     */   public UpdateResponse(JSONObject paramJSONObject)
/*     */   {
/*  65 */     super(paramJSONObject);
/*  66 */     a(paramJSONObject);
/*     */   }
/*     */ 
/*     */   private void a(JSONObject paramJSONObject)
/*     */   {
/*     */     try
/*     */     {
/*  75 */       this.hasUpdate = "Yes".equalsIgnoreCase(paramJSONObject.optString("update"));
/*     */ 
/*  77 */       if (this.hasUpdate) {
/*  78 */         this.updateLog = paramJSONObject.getString("update_log");
/*  79 */         this.version = paramJSONObject.getString("version");
/*  80 */         this.path = paramJSONObject.getString("path");
/*     */ 
/*  82 */         this.target_size = paramJSONObject.optString("target_size");
/*  83 */         this.new_md5 = paramJSONObject.optString("new_md5");
/*  84 */         this.delta = paramJSONObject.optBoolean("delta");
/*     */ 
/*  86 */         if (this.delta) {
/*  87 */           this.patch_md5 = paramJSONObject.optString("patch_md5");
/*  88 */           this.size = paramJSONObject.optString("size");
/*  89 */           this.origin = paramJSONObject.optString("origin");
/*     */         }
/*     */       }
/*     */     }
/*     */     catch (Exception localException) {
/*  94 */       localException.printStackTrace();
/*     */     }
/*     */   }
/*     */ 
/*     */   public String a(Context paramContext, boolean paramBoolean)
/*     */   {
/* 104 */     String str1 = paramContext.getString(c.a(paramContext).g("UMNewVersion"));
/* 105 */     String str2 = paramContext.getString(c.a(paramContext).g("UMTargetSize"));
/* 106 */     String str3 = paramContext.getString(c.a(paramContext).g("UMUpdateSize"));
/* 107 */     String str4 = paramContext.getString(c.a(paramContext).g("UMUpdateContent"));
/* 108 */     String str5 = paramContext.getString(c.a(paramContext).g("UMDialog_InstallAPK"));
/*     */ 
/* 110 */     if (paramBoolean)
/* 111 */       return String.format("%s %s\n%s\n\n%s\n%s\n", new Object[] { 
/* 115 */         str1, this.version, 
/* 116 */         str5, 
/* 117 */         str4, 
/* 118 */         this.updateLog });
/*     */     String str6;
/* 123 */     if (this.delta)
/* 124 */       str6 = String.format("\n%s %s", new Object[] { str3, h.c(this.size) });
/*     */     else {
/* 126 */       str6 = "";
/*     */     }
/*     */ 
/* 129 */     return String.format("%s %s\n%s %s%s\n\n%s\n%s\n", new Object[] { 
/* 133 */       str1, this.version, 
/* 134 */       str2, h.c(this.target_size), str6, 
/* 135 */       str4, 
/* 136 */       this.updateLog });
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.update.UpdateResponse
 * JD-Core Version:    0.6.2
 */